package com.toocms.jinjuhang.ui.mine.payment.bank;

import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.qmuiteam.qmui.arch.QMUIFragment;
import com.toocms.jinjuhang.data.center.BankCardData;
import com.toocms.tab.base.ItemViewModel;
import com.toocms.tab.binding.command.BindingCommand;

/**
 * @Description:
 * @Author: Zero
 * @CreateDate: 2023/5/18 15:08
 */
public class BankListItemModel extends ItemViewModel<BankListModel> {

    public ObservableField<BankCardData> bankCardDataObservableField = new ObservableField<>();

    public BankListItemModel(@NonNull BankListModel viewModel, BankCardData bankCardData) {
        super(viewModel);
        bankCardDataObservableField.set(bankCardData);
    }

    public BindingCommand click = new BindingCommand(() -> {
        Intent intent = new Intent();
        intent.putExtra("signid", bankCardDataObservableField.get().getSignid());
        intent.putExtra("card_no", bankCardDataObservableField.get().getCard_no());
        viewModel.setFragmentResult(QMUIFragment.RESULT_OK, intent);
        viewModel.finishFragment();
    });
}
